package com.yt.bigdata;

public class ParentClass {
    public static void main(String[] args) throws Exception {
        //创建ParentClass和ChildClass实例
        ParentClass pc = new ParentClass();
        ParentClass cc = new ChildClass();

        //获取类名
        Class parent = pc.getClass();
        System.out.println("Parent Class: " + parent);

        Class child = cc.getClass();
        System.out.println("Child Class: " + child);
        ChildClass childClass = new ChildClass();
        boolean b = childClass instanceof ParentClass;
        System.out.println(b);
    }
}

class ChildClass extends ParentClass {

}